package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

/**
 * 用户
 */
@Data
@ApiModel(value = "用户实体")
@TableName("t_user")
public class UserBean {
    @ApiModelProperty(hidden = true)
    @TableId(value = "pk_userId",type = IdType.AUTO)
    private Integer id;
    @ApiModelProperty(value = "用户名")
    @TableField("u_name")
    private String name;
    @ApiModelProperty(value = "密码")
    @TableField("u_pwd")
    private String pwd="123";
    @ApiModelProperty(value = "真实名字")
    @TableField("u_realName")
    private String realName;
    @ApiModelProperty(value = "角色集合")
    @TableField(exist = false)
    List<RoleBean> roleList;//角色集合
    @ApiModelProperty(value = "权限集合")
    @TableField(exist = false)
    List<PowerBean> powerList;//权限集合

    public UserBean() {
    }

    public UserBean(String name, String realName) {
        this.name = name;
        this.realName = realName;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPwd() {
        return pwd;
    }

    public void setPwd(String pwd) {
        this.pwd = pwd;
    }

    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }

    public List<RoleBean> getRoleList() {
        return roleList;
    }

    public void setRoleList(List<RoleBean> roleList) {
        this.roleList = roleList;
    }

    public List<PowerBean> getPowerList() {
        return powerList;
    }

    public void setPowerList(List<PowerBean> powerList) {
        this.powerList = powerList;
    }

    @Override
    public String toString() {
        return "UserBean{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", pwd='" + pwd + '\'' +
                ", realName='" + realName + '\'' +
                ", roleList=" + roleList +
                ", powerList=" + powerList +
                '}';
    }
}
